'use strict';

var Koa = require('koa');
var bodyParser = require('koa-bodyparser');
var controller = require('./controllers');
var staticRes = require('koa-static');
var templating = require('./templating');
var model = require('./models');
var session=require('./session');
var app = new Koa();

 app.use(session(app));

app.use(staticRes(__dirname));

app.use(bodyParser());

app.use(templating);

app.use(controller());


(async ()=>{
    console.log('正在初始化数据表。。。');
    // await model.sync();
})();

var port = 3000;
app.listen(port);

console.log(`http://127.0.0.1:${port}`);


